Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add sync #173

Merged
merged 2 commits into from
Jun 14, 2024
Merged

Feature/add sync #173

merged 2 commits into from
Jun 14, 2024

Conversation

River-sh
Copy link
Contributor

@River-sh River-sh commented Jun 3, 2024

  1. bugfix: fix vpn link and rule leak
  2. add regular sync raven rules

@River-sh River-sh force-pushed the feature/add_sync branch 11 times, most recently from e7bca45 to 08f10a8 Compare June 4, 2024 09:16
…tain the current VPN link status, and compare the expected status with the current status for configuration. (Wireguard has the same principle)

2. Add a regular synchronization mechanism
Comment on lines -1 to -41
/*
Copyright 2023 The OpenYurt Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package utils

import (
"fmt"
)

func FormatProxyServer(format string, args ...interface{}) string {
s := fmt.Sprintf(format, args...)
return fmt.Sprintf("[Proxy Server]: %s", s)
}

func FormatProxyClient(format string, args ...interface{}) string {
s := fmt.Sprintf(format, args...)
return fmt.Sprintf("[Proxy Client]: %s", s)
}

func FormatTunnel(format string, args ...interface{}) string {
s := fmt.Sprintf(format, args...)
return fmt.Sprintf("[Tunnel Agent]: %s", s)
}

func FormatRavenEngine(format string, args ...interface{}) string {
s := fmt.Sprintf(format, args...)
return fmt.Sprintf("[Raven Engine]: %s", s)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was the format method removed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem to be necessary, some lib logs do not have this mark

Comment on lines +576 to +581
time.Sleep(time.Second)
err = vx.ipset.Flush()
if err != nil {
errList = errList.Append(fmt.Errorf("error flushing ipset: %s", err))
}
time.Sleep(time.Second)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary, using the tool quickly may cause the tool to return an unnecessary error message when it is busy.

@@ -0,0 +1,129 @@
/*
Copyright 2023 The OpenYurt Authors.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2024

Comment on lines +560 to +563
err = vpndriveripset.CleanupRavenSkipNATIPSet()
if err != nil {
errList = errList.Append(fmt.Errorf("error cleanup ipset %s, %s", vpndriveripset.RavenSkipNatSet, err.Error()))
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to check here whether the node is a Gateway?

Copy link
Contributor Author

@River-sh River-sh Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When cleaning is needed, it is impossible to determine whether it is a gateway

@njucjc njucjc merged commit 2199e01 into openyurtio:main Jun 14, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants